module.exports = {
    publicPath: "/",
    outputDir: 'yc-jtj',
    assetsDir: 'static/index/assets',
    devServer: {
        host: '0.0.0.0',
        port: 8080,
        open: false,
        proxy: {
            // detail: https://cli.vuejs.org/config/#devserver-proxy
            [process.env.VUE_APP_BASE_API]: {
                // target: `http://192.168.31.103:8064/`, // 胡-本地
                // target: `http://192.168.31.110:8065/prod-api`, // 物理机
                target: `https://colloidal.zhenyuansw.com/prod-api`, // 线上
                changeOrigin: true,
                pathRewrite: {
                    ['^' + process.env.VUE_APP_BASE_API]: ''
                }
            }
        },
        disableHostCheck: true
    },
    // 关闭eslint校验
    lintOnSave: false,
    // 添加此配置以在生产环境中移除console.log
    configureWebpack: config => {
        if (process.env.NODE_ENV === 'production') {
            config.optimization.minimizer.forEach(minimizer => {
                // 假设minimizer是一个TerserPlugin实例
                if (minimizer.constructor.name === 'TerserPlugin') {
                    minimizer.options.terserOptions.compress.drop_console = true; // 移除console.log
                }
            });
        }
    },
}
